package com.zmc.lostfound.system.vo;

import com.zmc.lostfound.common.valid.AddGroup;
import com.zmc.lostfound.common.valid.UpdateGroup;
import com.zmc.lostfound.common.valid.ValueIntList;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * @author GXC
 * @description 反馈信息新增/修改请求体
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("反馈信息新增/修改请求体")
public class FeedbackSaveVO implements Serializable {

    private static final long serialVersionUID = 3039645087914143139L;

    /**
     * 反馈信息id
     */
    @ApiModelProperty("反馈信息id")
    @Null(message = "新增反馈信息: 反馈信息id必须为空", groups = {AddGroup.class})
    @NotNull(message = "修改反馈信息: 反馈信息id不能为空", groups = {UpdateGroup.class})
    @Min(value = 1, message = "修改反馈信息: 反馈信息id必须大于等于1", groups = {UpdateGroup.class})
    private Long id;

    /**
     * 反馈人id
     */
    @ApiModelProperty("反馈人id")
    @NotNull(message = "新增反馈信息: 反馈人id不能为空", groups = {AddGroup.class})
    @Min(value = 1, message = "反馈人id必须大于等于1", groups = {AddGroup.class, UpdateGroup.class})
    private Long userId;

    /**
     * 功能模块id
     */
    @ApiModelProperty("功能模块id")
    @NotNull(message = "新增反馈信息: 功能模块id不能为空", groups = {AddGroup.class})
    @Min(value = 1, message = "功能模块id必须大于等于1", groups = {AddGroup.class, UpdateGroup.class})
    private Long functionId;

    /**
     * 反馈类型(0:困惑与建议，1:Bug缺陷，2:申诉)
     */
    @ApiModelProperty("反馈类型")
    @NotNull(message = "新增反馈信息: 反馈类型不能为空", groups = {AddGroup.class})
    @ValueIntList(values = {0, 1, 2}, message = "反馈类型只能为0或1或2(0:困惑与建议，1:Bug缺陷，2:申诉)", groups = {AddGroup.class, UpdateGroup.class})
    private Integer type;

    /**
     * 反馈标题
     */
    @ApiModelProperty("反馈标题")
    @NotBlank(message = "新增反馈信息: 反馈标题不能为空", groups = {AddGroup.class})
    private String title;

    /**
     * 反馈内容
     */
    @ApiModelProperty("反馈内容")
    @NotBlank(message = "新增反馈信息: 反馈内容不能为空", groups = {AddGroup.class})
    private String content;

}
